<template>
  <Listitem :list="list"></Listitem>
</template>

<script>
import Listitem from "@/components/Listitem.vue";
import axios from "axios";
export default {
  created() {
    this.getList();
  },
  methods: {
    async getList() {
      console.log("5555");
      const res = await axios({
        url: "https://interview-api-t.itheima.net/h5/interview/opt/list",
        params: { page: 1, pageSize: 10, optType: 2 },
        headers: {
          Authorization: `Bearer ${localStorage.getItem("token")}`,
        },
      });
      console.log(res.data);
      this.list = res.data.data.rows;
    },
  },
  name: "HmLike",
  components: {
    Listitem,
  },
  data() {
    return {
      list: [],
    };
  },
};
</script>

<style></style>
